home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 4
/
Aminet 4 - November 1994.iso
/
aminet
/
dev
/
obero
/
oberon_lib.lha
/
oberon-a
/
source1.lha
/
source
/
Amiga
/
Exec.mod
< prev
next >
Wrap
Text File
|
1994-08-08
|
56KB
|
1,801 lines
(***************************************************************************
$RCSfile: Exec.mod $
Description: Interface to exec.library
Created by: fjc (Frank Copeland)
$Revision: 3.2 $
$Author: fjc $
$Date: 1994/08/08 00:42:52 $
Includes Release 40.15
(C) Copyright 1985-1993 Commodore-Amiga, Inc.
All Rights Reserved
Oberon-A interface Copyright © 1994, Frank Copeland.
This file is part of the Oberon-A Interface.
See Oberon-A.doc for conditions of use and distribution.
***************************************************************************)
MODULE Exec;
(*
** $C- CaseChk $I- IndexChk $L+ LongAdr $N- NilChk
** $P- PortableCode $R- RangeChk $S- StackChk $T- TypeChk
** $V- OvflChk $Z- ZeroVars
*)
IMPORT SYS := SYSTEM;
(**-- Pointer declarations ---------------------------------------------*)
TYPE
MinNodePtr* = CPOINTER TO MinNode;
NodePtr* = CPOINTER TO Node;
MinListPtr* = CPOINTER TO MinList;
ListPtr* = CPOINTER TO List;
ResidentPtr* = CPOINTER TO Resident;
MemChunkPtr* = CPOINTER TO MemChunk;
MemHeaderPtr* = CPOINTER TO MemHeader;
MemEntryPtr* = CPOINTER TO MemEntry;
MemListPtr* = CPOINTER TO MemList;
TaskPtr* = CPOINTER TO Task;
StackSwapStructPtr* = CPOINTER TO StackSwapStruct;
MsgPortPtr* = CPOINTER TO MsgPort;
MsgPortSoftIntPtr* = CPOINTER TO MsgPortSoftInt;
MessagePtr* = CPOINTER TO Message;
InterruptPtr* = CPOINTER TO Interrupt;
IntVectorPtr = CPOINTER TO IntVector;
SoftIntListPtr = CPOINTER TO SoftIntList;
SemaphoreRequestPtr = CPOINTER TO SemaphoreRequest;
SignalSemaphorePtr* = CPOINTER TO SignalSemaphore;
SemaphorePtr* = CPOINTER TO Semaphore;
LibraryPtr* = CPOINTER TO Library;
DevicePtr* = CPOINTER TO Device;
UnitPtr* = CPOINTER TO Unit;
IORequestPtr* = CPOINTER TO IORequest;
IOStdReqPtr* = CPOINTER TO IOStdReq;
ExecBasePtr* = CPOINTER TO ExecBase;
MemHandlerDataPtr * = CPOINTER TO MemHandlerData;
(**-- Library definitions ----------------------------------------------*)
(*
** $VER: initializers.h 39.0 (15.10.91)
**
** Macros for use with the InitStruct() function.
**
** Not ported.
*)
(*
** $VER: types.h 40.1 (10.8.93)
**
** Data typing.
*)
CONST
includeVersion* = 40; (* Version of the include files in use. (Do not
use this label for OpenLibrary() calls!) *)
TYPE
(* WARNING: APTR was redefined for the V36 Includes! APTR is a *)
(* 32-Bit Absolute Memory Pointer. C pointer math will not *)
(* operate on APTR -- use "ULONG *" instead. *)
APTR * = SYS.CPTR; (* 32-bit untyped pointer *)
LONG * = LONGINT; (* signed 32-bit quantity *)
ULONG * = LONGINT; (* unsigned 32-bit quantity *)
LONGBITS* = SET; (* 32 bits manipulated individually *)
WORD * = INTEGER; (* signed 16-bit quantity *)
UWORD * = INTEGER; (* unsigned 16-bit quantity *)
WORDBITS* = SYS.WORDSET; (* 16 bits manipulated individually *)
BYTE * = SHORTINT; (* signed 8-bit quantity *)
UBYTE * = SYS.BYTE; (* unsigned 8-bit quantity *)
BYTEBITS* = SYS.BYTESET; (* 8 bits manipulated individually *)
RPTR * = INTEGER; (* signed relative pointer *)
STRING * = ARRAY 32767 OF CHAR;
STRPTR * = CPOINTER TO STRING; (* string pointer (NULL terminated) *)
LSTRPTR * = STRPTR;
(* For compatibility only: (don't use in new code) *)
SHORT * = INTEGER; (* signed 16-bit quantity (use WORD) *)
USHORT * = INTEGER; (* unsigned 16-bit quantity (use UWORD) *)
COUNT * = INTEGER;
UCOUNT * = INTEGER;
CPTR * = ULONG;
(* Types with specific semantics *)
FLOAT * = REAL;
DOUBLE * = ARRAY 2 OF SYS.LONGWORD;
SINGLE * = SYS.LONGWORD;
BOOL * = INTEGER;
TEXT * = CHAR;
CONST
NULL * = NIL;
byteMask * = 0FFH;
(* Types convenient for Oberon-A programmers *)
TYPE
PROC * = PROCEDURE;
LBOOL * = LONGINT;
LONGBOOL * = LBOOL;
BSET * = SYS.BYTESET;
WSET * = SYS.WORDSET;
(* Legal values for LBOOL types *)
CONST
LFALSE * = 0;
LTRUE * = 1;
(* libraryVersion is now obsolete. Please use libraryMinimum *)
(* or code the specific minimum library version you require. *)
libraryMinimum* = 33; (* Lowest version supported by Commodore-Amiga *)
(*
** $VER: nodes.h 39.0 (15.10.91)
**
** Nodes & Node type identifiers.
*)
TYPE
(*
* List Node Structure. Each member in a list starts with a Node
*)
(* minimal node -- no type checking possible *)
MinNode* = RECORD
succ* : MinNodePtr; (* Pointer to next (successor) *)
pred* : MinNodePtr; (* Pointer to previous (predecessor) *)
END; (* MinNode *)
Node* = RECORD (MinNode)
type* : UBYTE;
pri* : SHORTINT; (* Priority, for sorting *)
name* : STRPTR; (* ID string, null terminated *)
END; (* Node *) (* Note: word aligned *)
CONST
(*
** Note: Newly initialized IORequests, and software interrupt structures
** used with Cause(), should have type ntUNKNOWN. The OS will assign a type
** when they are first used.
*)
(* ----- Node Types for Node.type -----*)
ntUnknown * = 0;
ntTask * = 1; (* Exec task *)
ntInterrupt * = 2;
ntDevice * = 3;
ntMsgPort * = 4;
ntMessage * = 5; (* Indicates message currently pending *)
ntFreeMsg * = 6;
ntReplyMsg * = 7; (* Message has been replied *)
ntResource * = 8;
ntLibrary * = 9;
ntMemory * = 10;
ntSoftInt * = 11; (* Internal flag used by SoftInits *)
ntFont * = 12;
ntProcess * = 13; (* AmigaDOS Process *)
ntSemaphore * = 14;
ntSignalSem * = 15; (* signal semaphores *)
ntBootNode * = 16;
ntKickMem * = 17;
ntGraphics * = 18;
ntDeathMessage* = 19;
ntUser * = 254; (* User node types work down from here *)
ntExtended * = 255;
(*
** $VER: lists.h 39.0 (15.10.91)
**
** Definitions and macros for use with Exec lists
*)
TYPE
(*
* Minimal List Header - no type checking
*)
MinList* = RECORD
head* : MinNodePtr;
tail* : MinNodePtr;
tailPred* : MinNodePtr;
END; (* MinList *) (* longword aligned *)
(*
* Full featured list header.
*)
List* = RECORD (MinList)
type* : UBYTE;
pad* : UBYTE;
END; (* List *) (* word aligned *)
(*
** $VER: alerts.h 39.3 (12.5.92)
**
** Alert numbers, as displayed by system crashes.
*)
(*********************************************************************
*
* Format of the alert error number:
*
* +-+-------------+----------------+--------------------------------+
* |D| SubSysId | General Error | SubSystem Specific Error |
* +-+-------------+----------------+--------------------------------+
* 1 7 bits 8 bits 16 bits
*
* D: DeadEnd alert
* SubSysId: indicates ROM subsystem number.
* General Error: roughly indicates what the error was
* Specific Error: indicates more detail
**********************************************************************)
(**********************************************************************
*
* Hardware/CPU specific alerts: They may show without the 8 at the
* front of the number. These are CPU/68000 specific. See 680x0
* programmer's manuals for more details.
*
**********************************************************************)
CONST
acpuBusErr * = 080000002H; (* Hardware bus fault/access error *)
acpuAddressErr * = 080000003H; (* Illegal address access (ie: odd) *)
acpuInstErr * = 080000004H; (* Illegal instruction *)
acpuDivZero * = 080000005H; (* Divide by zero *)
acpuCHK * = 080000006H; (* Check instruction error *)
acpuTRAPV * = 080000007H; (* TrapV instruction error *)
acpuPrivErr * = 080000008H; (* Privilege violation error *)
acpuTrace * = 080000009H; (* Trace error *)
acpuLineA * = 08000000AH; (* Line 1010 Emulator error *)
acpuLineF * = 08000000BH; (* Line 1111 Emulator error *)
acpuFormat * = 08000000EH; (* Stack frame format error *)
acpuSpurious * = 080000018H; (* Spurious interrupt error *)
acpuAutoVec1 * = 080000019H; (* AutoVector Level 1 interrupt error *)
acpuAutoVec2 * = 08000001AH; (* AutoVector Level 2 interrupt error *)
acpuAutoVec3 * = 08000001BH; (* AutoVector Level 3 interrupt error *)
acpuAutoVec4 * = 08000001CH; (* AutoVector Level 4 interrupt error *)
acpuAutoVec5 * = 08000001DH; (* AutoVector Level 5 interrupt error *)
acpuAutoVec6 * = 08000001EH; (* AutoVector Level 6 interrupt error *)
acpuAutoVec7 * = 08000001FH; (* AutoVector Level 7 interrupt error *)
(*********************************************************************
*
* General Alerts
*
* For example: timer.device cannot open math.library would be 05038015H
*
* alert(an_timerdev|ag_openlib|ao_MathLib);
*
*********************************************************************)
CONST
(* ------ alert types *)
atDeadEnd * = 80000000H;
atRecovery * = 00000000H;
(* ------ general purpose alert codes *)
agNoMemory * = 00010000H;
agMakeLib * = 00020000H;
agOpenLib * = 00030000H;
agOpenDev * = 00040000H;
agOpenRes * = 00050000H;
agIoError * = 00060000H;
agNoSignal * = 00070000H;
agBadParm * = 00080000H;
agCloseLib * = 00090000H; (* usually too many closes *)
agCloseDev * = 000A0000H; (* or a mismatched close *)
agProcCreate * = 000B0000H; (* Process creation failed *)
(* ------ alert objects: *)
aoExecLib * = 00008001H;
aoGraphicsLib * = 00008002H;
aoLayersLib * = 00008003H;
aoIntuition * = 00008004H;
aoMathLib * = 00008005H;
aoDosLib * = 00008007H;
aoRamLib * = 00008008H;
aoIconLib * = 00008009H;
aoExpansionLib* = 0000800AH;
aoDiskfontLib * = 0000800BH;
aoUtilityLib * = 0000800CH;
aoKeyMapLib * = 0000800DH;
aoAudioDev * = 00008010H;
aoConsoleDev * = 00008011H;
aoGamePortDev * = 00008012H;
aoKeyboardDev * = 00008013H;
aoTrackDiskDev* = 00008014H;
aoTimerDev * = 00008015H;
aoCiaRsrc * = 00008020H;
aoDiskRsrc * = 00008021H;
aoMiscRsrc * = 00008022H;
aoBootStrap * = 00008030H;
aoWorkbench * = 00008031H;
aoDiskCopy * = 00008032H;
aoGadTools * = 00008033H;
aoUnknown * = 00008035H;
(*********************************************************************
*
* Specific Alerts:
*
*********************************************************************)
(* ------ exec.library *)
anExecLib * = 01000000H;
anExcptVect * = 01000001H; (* 68000 exception vector checksum (obs.) *)
anBaseChkSum * = 01000002H; (* Execbase checksum (obs.) *)
anLibChkSum * = 01000003H; (* Library checksum failure *)
anMemCorrupt * = 81000005H; (* Corrupt memory list detected in FreeMem *)
anIntrMem * = 81000006H; (* No memory for interrupt servers *)
anInitAPtr * = 01000007H; (* InitStruct() of an APTR source (obs.) *)
anSemCorrupt * = 01000008H; (* A semaphore is in an illegal state
at ReleaseSempahore() *)
anFreeTwice * = 01000009H; (* Freeing memory already freed *)
anBogusExcpt * = 8100000AH; (* illegal 68k exception taken (obs.) *)
anIOUsedTwice * = 0100000BH; (* Attempt to reuse active IORequest *)
anMemoryInsane* = 0100000CH; (* Sanity check on memory list failed
during availmem(memfLARGEST) *)
anIOAfterClose* = 0100000DH; (* IO attempted on closed IORequest *)
anStackProbe * = 0100000EH; (* Stack appears to extend out of range *)
anBadFreeAddr * = 0100000FH; (* Memory header not located. [ Usually an
invalid address passed to FreeMem() ] *)
anBadSemaphore* = 01000010H; (* An attempt was made to use the old
message semaphores. *)
(* ------ graphics.library *)
anGraphicsLib * = 02000000H;
anGfxNoMem * = 82010000H; (* graphics out of memory *)
anGfxNoMemMspc* = 82010001H; (* MonitorSpec alloc, no memory *)
anLongFrame * = 82010006H; (* long frame, no memory *)
anShortFrame * = 82010007H; (* short frame, no memory *)
anTextTmpRas * = 02010009H; (* text, no memory for TmpRas *)
anBltBitMap * = 8201000AH; (* BltBitMap, no memory *)
anRegionMemory* = 8201000BH; (* regions, memory not available *)
anMakeVPort * = 82010030H; (* MakeVPort, no memory *)
anGfxNewError * = 0200000CH;
anGfxFreeError* = 0200000DH;
anGfxNoLCM * = 82011234H; (* emergency memory not available *)
anObsoleteFont* = 02000401H; (* unsupported font description used *)
(* ------ layers.library *)
anLayersLib * = 03000000H;
anLayersNoMem * = 83010000H; (* layers out of memory *)
(* ------ intuition.library *)
anIntuition * = 04000000H;
anGadgetType * = 84000001H; (* unknown gadget type *)
anBadGadget * = 04000001H; (* Recovery form of GadgetType *)
anCreatePort * = 84010002H; (* create port, no memory *)
anItemAlloc * = 04010003H; (* item plane alloc, no memory *)
anSubAlloc * = 04010004H; (* sub alloc, no memory *)
anPlaneAlloc * = 84010005H; (* plane alloc, no memory *)
anItemBoxTop * = 84000006H; (* item box top < RelZero *)
anOpenScreen * = 84010007H; (* open screen, no memory *)
anOpenScrnRast* = 84010008H; (* open screen, raster alloc, no memory *)
anSysScrnType * = 84000009H; (* open sys screen, unknown type *)
anAddSWGadget * = 8401000AH; (* add SW gadgets, no memory *)
anOpenWindow * = 8401000BH; (* open window, no memory *)
anBadState * = 8400000CH; (* Bad State Return entering Intuition *)
anBadMessage * = 8400000DH; (* Bad Message received by IDCMP *)
anWeirdEcho * = 8400000EH; (* Weird echo causing incomprehension *)
anNoConsole * = 8400000FH; (* couldn't open the Console Device *)
anNoISem * = 004000010H; (* Intuition skipped obtaining a sem *)
anISemOrder * = 004000011H; (* Intuition obtained a sem in bad order *)
(* ------ math.library *)
anMathLib * = 05000000H;
(* ------ dos.library *)
anDosLib * = 07000000H;
anStartMem * = 07010001H; (* no memory at startup *)
anEndTask * = 07000002H; (* EndTask didn't *)
anQPktFail * = 07000003H; (* Qpkt failure *)
anAsyncPkt * = 07000004H; (* Unexpected packet received *)
anFreeVec * = 07000005H; (* Freevec failed *)
anDiskBlkSeq * = 07000006H; (* Disk block sequence error *)
anBitMap * = 07000007H; (* Bitmap corrupt *)
anKeyFree * = 07000008H; (* Key already free *)
anBadChkSum * = 07000009H; (* Invalid checksum *)
anDiskError * = 0700000AH; (* Disk Error *)
anKeyRange * = 0700000BH; (* Key out of range *)
anBadOverlay * = 0700000CH; (* Bad overlay *)
anBadInitFunc * = 0700000DH; (* Invalid init packet for cli/shell *)
anFileReclosed* = 0700000EH; (* A filehandle was closed more than once *)
(* ------ ramlib.library *)
anRAMLib * = 08000000H;
anBadSegList * = 08000001H; (* no overlays in library seglists *)
(* ------ icon.library *)
anIconLib * = 09000000H;
(* ------ expansion.library *)
anExpansionLib* = 0A000000H;
anBadExpansionFree * = 0A000001H; (* freeed free region *)
(* ------ diskfont.library *)
anDiskfontLib * = 0B000000H;
(* ------ audio.device *)
anAudioDev * = 10000000H;
(* ------ console.device *)
anConsoleDev * = 11000000H;
anNoWindow * = 11000001H; (* Console can't open initial window *)
(* ------ gameport.device *)
anGamePortDev * = 12000000H;
(* ------ keyboard.device *)
anKeyboardDev * = 13000000H;
(* ------ trackdisk.device *)
anTrackDiskDev* = 14000000H;
anTDCalibSeek * = 14000001H; (* calibrate: seek error *)
anTDDelay * = 14000002H; (* delay: error on timer wait *)
(* ------ timer.device *)
anTimerDev * = 15000000H;
anTMBadReq * = 15000001H; (* bad request *)
anTMBadSupply * = 15000002H; (* power supply -- no 50/60Hz ticks *)
(* ------ cia.resource *)
anCIARsrc * = 20000000H;
(* ------ disk.resource *)
anDiskRsrc * = 21000000H;
anDRHasDisk * = 21000001H; (* get unit: already has disk *)
anDRIntNoAct * = 21000002H; (* interrupt: no active unit *)
(* ------ misc.resource *)
anMiscRsrc * = 22000000H;
(* ------ bootstrap *)
anBootStrap * = 30000000H;
anBootError * = 30000001H; (* boot code returned an error *)
(* ------ Workbench *)
anWorkbench * = 31000000H;
anNoFonts * = 0B1000001H;
anWBBadStartupMsg1 * = 31000001H;
anWBBadStartupMsg2 * = 31000002H;
anWBBadIOMsg * = 31000003H;
anWBReLayoutToolMenu * = 0B1010009H;
(* The following are in the V37 includes, but not the V40 *)
anWBInitPotionAllocDrawer * = 0B1010004H;
anWBCreateWBMenusCreateMenus1 * = 0B1010005H;
anWBCreateWBMenusCreateMenus2 * = 0B1010006H;
anWBLayoutWBMenusLayoutMenus * = 0B1010007H;
anWBAddToolMenuItem * = 0B1010008H;
anWBinitTimer * = 0B101000AH;
anWBInitLayerDemon * = 0B101000BH;
anWBinitWbGels * = 0B101000CH;
anWBInitScreenAndWindows1 * = 0B101000DH;
anWBInitScreenAndWindows2 * = 0B101000EH;
anWBInitScreenAndWindows3 * = 0B101000FH;
anWBMAlloc * = 0B1010010H;
(* ------ DiskCopy *)
anDiskCopy * = 32000000H;
(* ------ toolkit for Intuition *)
anGadTools * = 33000000H;
(* ------ System utility library *)
anUtilityLib * = 34000000H;
(* ------ For use by any application that needs it *)
anUnknown * = 35000000H;
(*
** $VER: errors.h 39.0 (15.10.91)
**
** Standard Device IO Errors (returned in ioError)
*)
ioErrOpenFail * = -1; (* device/unit failed to open *)
ioErrAborted * = -2; (* request terminated early [after AbortIO()] *)
ioErrNoCmd * = -3; (* command not supported by device *)
ioErrBadLength * = -4; (* not a valid length (usually ioLENGTH) *)
ioErrBadAddress* = -5; (* invalid address (misaligned or bad range) *)
ioErrUnitBusy * = -6; (* device opens ok, but requested unit is busy *)
ioErrSelfTest * = -7; (* hardware failed self-test *)
(*
** $VER: resident.h 39.0 (15.10.91)
**
** Resident/ROMTag stuff. Used to identify and initialize code modules.
*)
TYPE
Resident* = RECORD
matchWord* : UWORD; (* word to match on (ILLEGAL) *)
matchTag* : ResidentPtr; (* pointer to the above *)
endSkip* : APTR; (* address to continue scan *)
flags* : BSET; (* various tag flags *)
version* : UBYTE; (* release version number *)
type* : UBYTE; (* type of module (ntXXXXXX) *)
pri* : SHORTINT; (* initialization priority *)
name* : STRPTR; (* pointer to node name *)
idString* : STRPTR; (* pointer to identification string *)
init* : APTR; (* pointer to init code *)
END; (* Resident *)
CONST
matchWord * = 4AFCH; (* The 68000 "ILLEGAL" instruction *)
rtAutoInit * = 7; (* Resident.init points to data structure *)
rtAfterDos * = 2;
rtSingleTask * = 1;
rtColdStart * = 0;
rtNever * = {};
(*
** $VER: memory.h 39.3 (21.5.92)
**
** Definitions and structures used by the memory allocation system
*)
TYPE
(****** MemChunk ****************************************************)
MemChunk* = RECORD
next* : MemChunkPtr; (* pointer to next chunk *)
bytes* : ULONG; (* chunk byte size *)
END; (* MemChunk *)
(****** MemHeader ***************************************************)
MemHeader* = RECORD (Node)
attributes* : WSET; (* characteristics of this region *)
first* : MemChunkPtr; (* first free region *)
lower* : APTR; (* lower memory bound *)
upper* : APTR; (* upper memory bound+1 *)
free* : ULONG; (* total number of free bytes *)
END; (* MemHeader *)
(****** MemEntry ****************************************************)
MemEntry* = RECORD
addr * : APTR; (* the address of this memory region *)
(** reqs * : SET; (* the AllocMem requirements *)
*
* This occupies the same space as addr (a C union). Access via:
* SYS.VAL (SET, MemEntry.addr)
*)
length * : ULONG; (* the length of this memory region *)
END; (* MemEntry *)
(****** MemList *****************************************************)
(* Note: SIZE (MemList) includes the size of the first MemEntry!
No it doesn't !! This is *Oberon*, not C !! *)
MemList* = RECORD (Node)
numEntries * : UWORD; (* number of entries in this struct *)
(*me * : ARRAY OF MemEntry; (* the first entry *)*)
END; (* MemList *)
CONST
(* ----- Memory Requirement Types ---------------------------*)
(* ----- See the AllocMem() documentation for details--------*)
memAny * = {}; (* Any type of memory will do *)
memPublic * = 0;
memChip * = 1;
memFast * = 2;
memLocal * = 8; (* Memory that does not go away at RESET *)
mem24BitDMA * = 9; (* DMAable memory within 24 bits of address *)
memKick * = 10; (* Memory that can be used for KickTags *)
memClear * = 16; (* AllocMem: NULL out area before return *)
memLargest * = 17; (* AvailMem: return the largest chunk size *)
memReverse * = 18; (* AllocMem: allocate from the top down *)
memTotal * = 19; (* AvailMem: return total size of memory *)
memNoExpunge* = 31; (*AllocMem: Do not cause expunge on failure *)
(* ----- Current alignment rules for memory blocks (may increase) -----*)
memBlockSize * = 8;
memBlockMask * = (memBlockSize-1);
TYPE
(****** MemHandlerData **********************************************)
(* Note: This structure is *READ ONLY* and only EXEC can create it!*)
MemHandlerData * = RECORD
requestSize * : ULONG; (* Requested allocation size *)
requestFlags * : SET; (* Requested allocation flags *)
flags * : SET; (* Flags (see below) *)
END;
CONST
memhRecycle * = 0; (* 0==First time, 1==recycle *)
(****** Low Memory handler return values ***************************)
memDidNothing * = 0; (* Nothing we could do... *)
memAllDone * = -1; (* We did all we could do *)
memTryAgain * = 1; (* We did some, try the allocation again *)
(*
** $VER: tasks.h 39.3 (18.9.92)
**
** Task Control Block, Singals, and Task flags.
*)
TYPE
(* Please use Exec functions to modify task structure fields, where available.
*)
Task* = RECORD (Node)
tcFlags* : BSET;
state* : BSET;
idNestCnt* : SHORTINT; (* intr disabled nesting*)
tdNestCnt* : SHORTINT; (* task disabled nesting*)
sigAlloc* : SET; (* sigs allocated *)
sigWait* : SET; (* sigs we are waiting for *)
sigRecvd* : SET; (* sigs we have received *)
sigExcept* : SET; (* sigs we will take excepts for *)
trapAlloc* : WSET; (* traps allocated *)
trapAble* : WSET; (* traps enabled *)
exceptData* : APTR; (* points to except data *)
exceptCode* : PROC; (* points to except code *)
trapData* : APTR; (* points to trap code *)
trapCode* : PROC; (* points to trap data *)
spReg* : APTR; (* stack pointer *)
spLower* : APTR; (* stack lower bound *)
spUpper* : APTR; (* stack upper bound + 2*)
switch* : PROC; (* task losing CPU *)
launch* : PROC; (* task getting CPU *)
memEntry* : List; (* Allocated memory. Freed by RemTask() *)
userData* : APTR; (* For use by the task; no restrictions! *)
END; (* Task *)
(*
* Stack swap structure as passed to StackSwap()
*)
StackSwapStruct* = RECORD
lower* : APTR; (* Lowest byte of stack *)
upper* : ULONG; (* Upper end of stack (size + Lowest) *)
pointer* : APTR; (* Stack pointer at switch point *)
END; (* StackSwapStruct *)
CONST
(* ----- Flag Bits ------------------------------------------*)
tProcTime * = 0;
tETask * = 3;
tStackChk * = 4;
tException * = 5;
tSwitch * = 6;
tLaunch * = 7;
(* ----- Task States ----------------------------------------*)
tsInvalid * = 0;
tsAdded * = 1;
tsRun * = 2;
tsReady * = 3;
tsWait * = 4;
tsExcept * = 5;
tsRemoved * = 6;
(* ----- Predefined Signals -------------------------------------*)
sigAbort * = 0;
sigChild * = 1;
sigBlit * = 4; (* Note: same as SINGLE *)
sigSingle * = 4; (* Note: same as BLIT *)
sigIntuition * = 5;
sigNet * = 7;
sigDos * = 8;
(*
** $VER: ports.h 39.0 (15.10.91)
**
** Message ports and Messages.
*)
TYPE
(****** MsgPort *****************************************************)
MsgPort* = RECORD (Node)
mpFlags* : BSET;
sigBit* : SHORTINT;(* signal bit number *)
sigTask* : TaskPtr; (* object to be signalled *)
msgList* : List; (* message linked list *)
END; (* MsgPort *)
MsgPortSoftInt* = RECORD (Node)
mpFlags* : BSET;
sigBit* : SHORTINT; (* signal bit number *)
softInt* : InterruptPtr; (* object to be signalled *)
msgList* : List; (* message linked list *)
END; (* MsgPort *)
CONST
(* MsgPort.flags: Port arrival actions (PutMsg) *)
pfAction * = {0,1}; (* Mask *)
paSignal * = {}; (* Signal task in mpSigTask *)
paSoftint * = {0}; (* Signal SoftInt in mpsoftint/mpSigTask *)
paIgnore * = {1}; (* Ignore arrival *)
TYPE
(****** Message *****************************************************)
Message* = RECORD (Node)
replyPort* : MsgPortPtr; (* message reply port *)
mnLength* : UWORD; (* total message length, in bytes *)
(* (include the size of the Message *)
(* structure in the length) *)
END; (* Message *)
(*
** $VER: interrupts.h 39.1 (18.9.92)
**
** Callback structures used by hardware & software interrupts
*)
TYPE
Interrupt* = RECORD (Node)
data* : APTR; (* server data segment *)
code* : PROC; (* server code entry *)
END; (* Interrupt *)
IntVector = RECORD (* For EXEC use ONLY! *)
data : APTR;
code : PROC;
node : NodePtr;
END; (* IntVector *)
SoftIntList = RECORD (List) (* For EXEC use ONLY! *)
shPad : UWORD;
END; (* SoftIntList *)
CONST
sihPriMask* = 0F0H;
(* this is a fake INT definition, used only for AddIntServer and the like *)
intNMI * = 15;
(*
** $VER: semaphores.h 39.1 (7.2.92)
**
** Definitions for locking functions.
*)
TYPE
(****** SignalSemaphore *********************************************)
(* Private structure used by ObtainSemaphore() *)
SemaphoreRequest = RECORD (MinNode)
waiter : TaskPtr;
END; (* SemaphoreRequest *)
(* Signal Semaphore data structure *)
SignalSemaphore* = RECORD (Node)
nestCount* : INTEGER;
waitQueue* : MinList;
multipleLink : SemaphoreRequest;
owner* : TaskPtr;
queueCount* : INTEGER;
END; (* SignalSemaphore *)
(****** Semaphore procure message (for use in V39 Procure/Vacate ****)
SemaphoreMessage * = RECORD (Message)
semaphore * : SignalSemaphorePtr;
END;
CONST
smShared * = 1;
smExclusive * = 0;
TYPE
(****** Semaphore (Old Procure/Vacate type, not reliable) ***********)
Semaphore* = RECORD (MsgPort) (* Do not use these semaphores! *)
bids* : INTEGER;
END; (* Semaphore *)
(*
** $VER: libraries.h 39.2 (10.4.92)
**
** Definitions for use when creating or using Exec libraries
*)
CONST
(* ------ Special Constants ---------------------------------------*)
libVectSize * = 6; (* Each library entry takes 6 bytes *)
libReserved * = 4; (* Exec reserves the first 4 vectors *)
libBase * = (-libVectSize);
libUserDef * = (libBase-(libReserved*libVectSize));
libNonStd * = (libUserDef);
(* ------ Standard Functions --------------------------------------*)
libOpen * = -6;
libClose * = -12;
libExpunge * = -18;
libExtFunc * = -24; (* for future expansion *)
TYPE
(* ------ Library Base Structure ----------------------------------*)
(* Also used for Devices and some Resources *)
Library* = RECORD (Node)
libFlags* : BSET;
pad* : UBYTE;
negSize* : UWORD; (* number of bytes before library *)
posSize* : UWORD; (* number of bytes after library *)
version* : UWORD; (* major *)
revision* : UWORD; (* minor *)
idString* : STRPTR; (* ASCII identification *)
sum* : ULONG; (* the checksum itself *)
openCnt* : UWORD; (* number of current opens *)
END; (* Library *) (* Warning: size is not a longword multiple! *)
CONST
(* Flags bit definitions (all others are system reserved) *)
libSumming * = 0; (* we are currently checksumming *)
libChanged * = 1; (* we have just changed the lib *)
libSumUsed * = 2; (* set if we should bother to sum *)
libDelExp * = 3; (* delayed expunge *)
(*
** $VER: io.h 39.0 (15.10.91)
**
** Message structures used for device communication
*)
TYPE
IORequest* = RECORD (Message)
device* : DevicePtr; (* device node pointer *)
unit* : UnitPtr; (* unit (driver private)*)
command* : UWORD; (* device command *)
ioFlags* : BSET;
error* : SHORTINT; (* error or warning num *)
END; (* IORequest *)
IOStdReq* = RECORD (IORequest)
actual* : ULONG; (* actual number of bytes transferred *)
ioLength* : ULONG; (* requested number bytes transferred*)
data* : APTR; (* points to data area *)
offset* : ULONG; (* offset for block structured devices *)
END; (* IOStdReq *)
CONST
(* library vector offsets for device reserved vectors *)
devBeginIO * = -30;
devAbortIO * = -36;
(* ioFlags defined bits *)
ioQuick * = 0;
cmdInvalid * = 0;
cmdReset * = 1;
cmdRead * = 2;
cmdWrite * = 3;
cmdUpdate * = 4;
cmdClear * = 5;
cmdStop * = 6;
cmdStart * = 7;
cmdFlush * = 8;
cmdNonstd * = 9;
(*
** $VER: devices.h 39.0 (15.10.91)
**
** Include file for use by Exec device drivers
*)
TYPE
(****** Device ******************************************************)
Device* = RECORD (Library) END;
(****** Unit ********************************************************)
Unit* = RECORD (MsgPort) (* queue for unprocessed messages *)
(* instance of msgport is recommended *)
unitFlags* : BSET;
unitPad* : UBYTE;
openCnt* : UWORD; (* number of active opens *)
END; (* Unit *)
CONST
unitActive * = 0;
unitInTask * = 1;
(*
** $VER: execbase.h 39.6 (18.1.93)
**
** Definition of the exec.library base structure.
*)
TYPE
(* Definition of the Exec library base structure (pointed to by location 4).
** Most fields are not to be viewed or modified by user programs. Use
** extreme caution.
*)
ExecBase* = RECORD (Library) (* Standard library node *)
(******** Static System Variables ********)
softVer* : UWORD; (* kickstart release number (obs.) *)
lowMemChkSum* : INTEGER; (* checksum of 68000 trap vectors *)
chkBase* : ULONG; (* system base pointer complement *)
coldCapture* : APTR; (* coldstart soft capture vector *)
coolCapture* : APTR; (* coolstart soft capture vector *)
warmCapture* : APTR; (* warmstart soft capture vector *)
sysStkUpper* : APTR; (* system stack base (upper bound) *)
sysStkLower* : APTR; (* top of system stack (lower bound) *)
maxLocMem* : APTR; (* top of chip memory *)
debugEntry* : APTR; (* global debugger entry point *)
debugData* : APTR; (* global debugger data segment *)
alertData* : APTR; (* alert data segment *)
maxExtMem* : APTR; (* top of extended mem, or null if none *)
chkSum* : UWORD; (* for all of the above (minus 2) *)
(****** Interrupt Related ***************************************)
intVects : ARRAY 16 OF IntVector;
(****** Dynamic System Variables *************************************)
thisTask* : TaskPtr; (* pointer to current task (readable) *)
idleCount* : ULONG; (* idle counter *)
dispCount* : ULONG; (* dispatch counter *)
quantum* : UWORD; (* time slice quantum *)
elapsed* : UWORD; (* current quantum ticks *)
sysFlags* : WSET; (* misc internal system flags *)
idNestCnt* : SHORTINT; (* interrupt disable nesting count *)
tdNestCnt* : SHORTINT; (* task disable nesting count *)
attnFlags* : WSET; (* special attention flags (readable) *)
attnResched* : UWORD; (* rescheduling attention *)
resModules* : APTR; (* resident module array pointer *)
taskTrapCode* : PROC;
taskExceptCode* : PROC;
taskExitCode* : PROC;
taskSigAlloc* : SET;
taskTrapAlloc* : WSET;
(****** System Lists (private!) ********************************)
memList- : List;
resourceList- : List;
deviceList- : List;
intrList- : List;
libList- : List;
portList- : List;
taskReady- : List;
taskWait- : List;
softInts : ARRAY 5 OF SoftIntList;
(****** Other Globals *******************************************)
lastAlert- : ARRAY 4 OF LONGINT;
(* these next two variables are provided to allow
** system developers to have a rough idea of the
** period of two externally controlled signals --
** the time between vertical blank interrupts and the
** external line rate (which is counted by CIA A's
** "time of day" clock). In general these values
** will be 50 or 60, and may or may not track each
** other. These values replace the obsolete afbPAL
** and afb50HZ flags.
*)
vBlankFrequency- : UBYTE; (* (readable) *)
powerSupplyFrequency- : UBYTE; (* (readable) *)
semaphoreList- : List;
(* these next two are to be able to kickstart into user ram.
** KickMemPtr holds a singly linked list of MemLists which
** will be removed from the memory list via AllocAbs. If
** all the AllocAbs's succeeded, then the KickTagPtr will
** be added to the rom tag list.
*)
kickMemPtr* : APTR; (* ptr to queue of mem lists *)
kickTagPtr* : APTR; (* ptr to rom tag queue *)
kickCheckSum* : APTR; (* checksum for mem and tags *)
(****** V36 Exec additions start here **************************************)
pad0 : UWORD;
launchPoint : ULONG; (* Private to Launch/Switch *)
ramLibPrivate : APTR;
(* The next ULONG contains the system "E" clock frequency,
** expressed in Hertz. The E clock is used as a timebase for
** the Amiga's 8520 I/O chips. (E is connected to "02").
** Typical values are 715909 for NTSC, or 709379 for PAL.
*)
eClockFrequency- : ULONG; (* (readable) *)
cacheControl : APTR; (* Private to CacheControl calls *)
taskID- : ULONG; (* Next available task ID *)
reserved1 : ARRAY 5 OF ULONG;
mmuLock : APTR; (* private *)
reserved2 : ARRAY 3 OF ULONG;
(****** V39 Exec additions start here **************************************)
(* The following list and data element are used
* for V39 exec's low memory handler...
*)
memHandlers- : MinList; (* The handler list *)
memHandler : APTR; (* Private! handler pointer *)
END; (* ExecBase *)
CONST
(****** Bit defines for AttnFlags (see above) ******************************)
(* Processors and Co-processors: *)
af68010 * = 0; (* also set for 68020 *)
af68020 * = 1; (* also set for 68030 *)
af68030 * = 2; (* also set for 68040 *)
af68040 * = 3;
af68881 * = 4; (* also set for 68882 *)
af68882 * = 5;
afFPU40 * = 6; (* Set if 68040 FPU *)
(*
* The afFPU40 bit is set when a working 68040 FPU
* is in the system. If this bit is set and both the
* af68881 and af68882 bits are not set, then the 68040
* math emulation code has not been loaded and only 68040
* FPU instructions are available. This bit is valid *ONLY*
* if the af68040 bit is set.
*)
afPrivate * = 15; (* Just what it says *)
(****** Selected flag definitions for Cache manipulation calls **********)
cacrEnableI * = 0; (* Enable instruction cache *)
cacrFreezeI * = 1; (* Freeze instruction cache *)
cacrClearI * = 3; (* Clear instruction cache *)
cacrIBE * = 4; (* Instruction burst enable *)
cacrEnableD * = 8; (* 68030 Enable data cache *)
cacrFreezeD * = 9; (* 68030 Freeze data cache *)
cacrClearD * = 11; (* 68030 Clear data cache *)
cacrDBE * = 12; (* 68030 Data burst enable *)
cacrWriteAllocate* = 13; (* 68030 Write-Allocate mode
(must always be set!) *)
cacrEnableE * = 30; (* Master enable for external caches *)
(* External caches should track the *)
(* state of the internal caches *)
(* such that they do not cache anything *)
(* that the internal cache turned off *)
(* for. *)
cacrCopyBack * = 31; (* Master enable for copyback caches *)
dmaContinue * = 1; (* Continuation flag for CachePreDMA *)
dmaNoModify * = 2; (* Set if DMA does not update memory *)
dmaReadFromRAM * = 3; (* Set if DMA goes *FROM* RAM to device *)
(**-- Library base pointer ---------------------------------------------*)
CONST
absExecBase = 4;
VAR
base*, SysBase* : ExecBasePtr;
(**-- Library functions ------------------------------------------------*)
(*
** $VER: exec_protos.h 39.15 (1.10.93)
*)
(* ------ misc ---------------------------------------------------------*)
LIBCALL (base : ExecBasePtr) Supervisor*
( userFunction [13] : PROC )
: APTR;
-30;
(* ------ special patchable hooks to internal exec activity ------------*)
(* ------ module creation ----------------------------------------------*)
LIBCALL (base : ExecBasePtr) InitCode*
( startClass [0] : BSET;
version [1] : ULONG );
-72;
LIBCALL (base : ExecBasePtr) InitStruct*
( initTable [9] : APTR;
memory [10] : APTR;
size [0] : ULONG );
-78;
LIBCALL (base : ExecBasePtr) MakeLibrary*
( funcInit [8] : APTR;
structInit [9] : APTR;
libInit [10] : PROC;
dataSize [0] : ULONG;
segList [1] : SYS.BPTR )
: LibraryPtr;
-84;
LIBCALL (base : ExecBasePtr) MakeFunctions*
( target [8] : APTR;
functionArray [9] : APTR;
funcDispBase [10] : APTR )
: ULONG;
-90;
LIBCALL (base : ExecBasePtr) FindResident*
( name [9] : ARRAY OF CHAR )
: ResidentPtr;
-96;
LIBCALL (base : ExecBasePtr) InitResident*
( resident [9] : ResidentPtr;
segList [1] : SYS.BPTR )
: APTR;
-102;
(* ------ diagnostics --------------------------------------------------*)
LIBCALL (base : ExecBasePtr) Alert*
( alertNum [7] : ULONG );
-108;
LIBCALL (base : ExecBasePtr) Debug*
( flags [0] : SET );
-114;
(* ------ interrupts ---------------------------------------------------*)
LIBCALL (base : ExecBasePtr) Disable* ();
-120;
LIBCALL (base : ExecBasePtr) Enable* ();
-126;
LIBCALL (base : ExecBasePtr) Forbid* ();
-132;
LIBCALL (base : ExecBasePtr) Permit* ();
-138;
LIBCALL (base : ExecBasePtr) SetSR*
( newSR [0] : WSET;
mask [1] : WSET )
: WSET;
-144;
LIBCALL (base : ExecBasePtr) SuperState* ();
-150;
LIBCALL (base : ExecBasePtr) UserState*
( sysStack [0] : APTR );
-156;
LIBCALL (base : ExecBasePtr) SetIntVector*
( intNumber [0] : ULONG;
interrupt [9] : InterruptPtr )
: InterruptPtr;
-162;
LIBCALL (base : ExecBasePtr) AddIntServer*
( intNumber [0] : ULONG;
interrupt [9] : InterruptPtr );
-168;
LIBCALL (base : ExecBasePtr) RemIntServer*
( intNumber [0] : ULONG;
interrupt [9] : InterruptPtr );
-174;
LIBCALL (base : ExecBasePtr) Cause*
( interrupt [9] : InterruptPtr );
-180;
(* ------ memory allocation --------------------------------------------*)
LIBCALL (base : ExecBasePtr) Allocate*
( freeList [8] : MemHeaderPtr;
byteSize [0] : ULONG )
: APTR;
- 186;
LIBCALL (base : ExecBasePtr) Deallocate*
( freeList [8] : MemHeaderPtr;
memoryBlock [9] : APTR;
byteSize [0] : ULONG );
-192;
LIBCALL (base : ExecBasePtr) AllocMem*
( byteSize [0] : ULONG;
requirements [1] : SET )
: APTR;
- 198;
LIBCALL (base : ExecBasePtr) AllocAbs*
( byteSize [0] : ULONG;
location [1] : APTR )
: APTR;
- 204;
LIBCALL (base : ExecBasePtr) FreeMem*
( memoryBlock [9] : APTR;
byteSize [0] : ULONG );
- 210;
LIBCALL (base : ExecBasePtr) AvailMem*
( requirements [1] : SET )
: ULONG;
- 216;
LIBCALL (base : ExecBasePtr) AllocEntry*
( entry [8] : APTR )
: APTR;
- 222;
LIBCALL (base : ExecBasePtr) FreeEntry*
( entry [8] : APTR );
- 228;
(* ------ lists --------------------------------------------------------*)
LIBCALL (base : ExecBasePtr) Insert*
( VAR list [8] : MinList;
node [9] : MinNodePtr;
pred [10] : MinNodePtr );
- 234;
LIBCALL (base : ExecBasePtr) AddHead*
( VAR list [8] : MinList;
node [9] : MinNodePtr );
- 240;
LIBCALL (base : ExecBasePtr) AddTail*
( VAR list [8] : MinList;
node [9] : MinNodePtr );
- 246;
LIBCALL (base : ExecBasePtr) Remove*
( node [9] : MinNodePtr );
- 252;
LIBCALL (base : ExecBasePtr) RemHead*
( VAR list [8] : MinList )
: MinNodePtr;
- 258;
LIBCALL (base : ExecBasePtr) RemHeadNode*
( VAR list [8] : MinList )
: NodePtr;
- 258;
LIBCALL (base : ExecBasePtr) RemTail*
( VAR list [8] : MinList )
: MinNodePtr;
- 264;
LIBCALL (base : ExecBasePtr) RemTailNode*
( VAR list [8] : MinList )
: NodePtr;
- 264;
LIBCALL (base : ExecBasePtr) Enqueue*
( VAR list [8] : MinList;
node [9] : NodePtr );
- 270;
LIBCALL (base : ExecBasePtr) FindName*
( VAR list [8] : MinList;
name [9] : ARRAY OF CHAR )
: NodePtr;
- 276;
LIBCALL (base : ExecBasePtr) FindNameNode*
( node [8] : NodePtr;
name [9] : ARRAY OF CHAR )
: NodePtr;
- 276;
(* ------ tasks --------------------------------------------------------*)
LIBCALL (base : ExecBasePtr) AddTask*
( task [9] : TaskPtr;
initPC [10] : PROC;
finalPC [11] : APTR );
- 282;
LIBCALL (base : ExecBasePtr) NewAddTask*
( task [9] : TaskPtr;
initPC [10] : PROC;
finalPC [11] : APTR )
: APTR;
- 282;
LIBCALL (base : ExecBasePtr) RemTask*
( task [9] : TaskPtr );
- 288;
LIBCALL (base : ExecBasePtr) FindTask*
( name [9] : STRPTR )
: TaskPtr;
- 294;
LIBCALL (base : ExecBasePtr) SetTaskPri*
( task [9] : TaskPtr;
priority [0] : LONGINT )
: SHORTINT;
- 300;
LIBCALL (base : ExecBasePtr) SetSignal*
( newSignals [0] : SET;
signalSet [1] : SET )
: SET;
- 306;
LIBCALL (base : ExecBasePtr) SetExcept*
( newSignals [0] : SET;
signalSet [1] : SET )
: SET;
- 312;
LIBCALL (base : ExecBasePtr) Wait*
( signalSet [0] : SET )
: SET;
- 318;
LIBCALL (base : ExecBasePtr) Signal*
( task [9] : TaskPtr;
signalSet [0] : SET );
- 324;
LIBCALL (base : ExecBasePtr) AllocSignal*
( signalNum [0] : LONGINT )
: SHORTINT;
- 330;
LIBCALL (base : ExecBasePtr) FreeSignal*
( signalNum [0] : LONGINT );
- 336;
LIBCALL (base : ExecBasePtr) AllocTrap*
( trapNum [0] : LONGINT )
: SHORTINT;
- 342;
LIBCALL (base : ExecBasePtr) FreeTrap*
( trapNum [0] : LONGINT );
- 348;
(* ------ messages -----------------------------------------------------*)
LIBCALL (base : ExecBasePtr) AddPort*
( port [9] : MsgPortPtr );
- 354;
LIBCALL (base : ExecBasePtr) RemPort*
( port [9] : MsgPortPtr );
- 360;
LIBCALL (base : ExecBasePtr) PutMsg*
( port [8] : MsgPortPtr;
message [9] : MessagePtr );
- 366;
LIBCALL (base : ExecBasePtr) GetMsg*
( port [8] : MsgPortPtr )
: MessagePtr;
- 372;
LIBCALL (base : ExecBasePtr) ReplyMsg*
( message [9] : MessagePtr );
- 378;
LIBCALL (base : ExecBasePtr) WaitPort*
( port [8] : MsgPortPtr );
- 384;
LIBCALL (base : ExecBasePtr) FindPort*
( name [9] : ARRAY OF CHAR )
: MsgPortPtr;
- 390;
(* ------ libraries ----------------------------------------------------*)
LIBCALL (base : ExecBasePtr) AddLibrary*
( library [9] : LibraryPtr );
- 396;
LIBCALL (base : ExecBasePtr) RemLibrary*
( library [9] : LibraryPtr );
- 402;
LIBCALL (base : ExecBasePtr) OldOpenLibrary*
( libName [9] : ARRAY OF CHAR )
: LibraryPtr;
- 408;
LIBCALL (base : ExecBasePtr) CloseLibrary*
( library [9] : LibraryPtr );
- 414;
LIBCALL (base : ExecBasePtr) SetFunction*
( library [9] : LibraryPtr;
funcOffset [8] : LONGINT;
newFunction [0] : PROC )
: PROC;
- 420;
LIBCALL (base : ExecBasePtr) SumLibrary*
( library [9] : LibraryPtr );
- 426;
(* ------ devices ------------------------------------------------------*)
LIBCALL (base : ExecBasePtr) AddDevice*
( device [9] : DevicePtr );
- 432;
LIBCALL (base : ExecBasePtr) RemDevice*
( device [9] : DevicePtr );
- 438;
LIBCALL (base : ExecBasePtr) OpenDevice*
( devName [8] : ARRAY OF CHAR;
unit [0] : ULONG;
ioRequest [9] : MessagePtr;
flags [1] : SET )
: SHORTINT;
- 444;
LIBCALL (base : ExecBasePtr) CloseDevice*
( ioRequest [9] : MessagePtr );
- 450;
LIBCALL (base : ExecBasePtr) DoIO*
( ioRequest [9] : MessagePtr )
: SHORTINT;
- 456;
LIBCALL (base : ExecBasePtr) OldDoIO*
( ioRequest [9] : MessagePtr );
- 456;
LIBCALL (base : ExecBasePtr) SendIO*
( ioRequest [9] : MessagePtr );
- 462;
LIBCALL (base : ExecBasePtr) CheckIO*
( ioRequest [9] : MessagePtr )
: IORequestPtr;
- 468;
LIBCALL (base : ExecBasePtr) WaitIO*
( ioRequest [9] : MessagePtr )
: SHORTINT;
- 474;
LIBCALL (base : ExecBasePtr) OldWaitIO*
( ioRequest [9] : MessagePtr );
- 474;
LIBCALL (base : ExecBasePtr) AbortIO*
( ioRequest [9] : MessagePtr );
- 480;
(* ------ resources ----------------------------------------------------*)
LIBCALL (base : ExecBasePtr) AddResource*
( resource [9] : APTR );
- 486;
LIBCALL (base : ExecBasePtr) RemResource*
( resource [9] : APTR );
- 492;
LIBCALL (base : ExecBasePtr) OpenResource*
( resName [9] : ARRAY OF CHAR )
: APTR;
- 498;
(* ------ private diagnostic support -----------------------------------*)
(* ------ misc ---------------------------------------------------------*)
LIBCALL (base : ExecBasePtr) RawDoFmt*
( formatString [8] : ARRAY OF CHAR;
dataStream [9] : APTR;
putChProc [10] : PROC;
putChData [11] : APTR )
: APTR;
- 522;
LIBCALL (base : ExecBasePtr) RawDoFmtL*
( formatString [8] : ARRAY OF CHAR;
dataStream [9] : ARRAY OF SYS.BYTE;
putChProc [10] : PROC;
putChData [11] : APTR )
: APTR;
- 522;
LIBCALL (base : ExecBasePtr) OldRawDoFmt*
( formatString [8] : ARRAY OF CHAR;
dataStream [9] : APTR;
putChProc [10] : PROC;
putChData [11] : APTR );
- 522;
LIBCALL (base : ExecBasePtr) OldRawDoFmtL*
( formatString [8] : ARRAY OF CHAR;
dataStream [9] : ARRAY OF SYS.BYTE;
putChProc [10] : PROC;
putChData [11] : APTR );
- 522;
LIBCALL (base : ExecBasePtr) GetCC* ()
: WSET;
- 528;
LIBCALL (base : ExecBasePtr) TypeOfMem*
( address [9] : APTR )
: SET;
- 534;
LIBCALL (base : ExecBasePtr) Procure*
( VAR semaphore [8] : Semaphore;
bidMsg [9] : MessagePtr )
: BOOLEAN;
- 540;
LIBCALL (base : ExecBasePtr) Vacate*
( VAR semaport [8] : Semaphore );
- 546;
LIBCALL (base : ExecBasePtr) OpenLibrary*
( libName [9] : ARRAY OF CHAR;
version [0] : ULONG )
: LibraryPtr;
- 552;
(* --- functions in V33 or higher (distributed as Release 1.2) ---*)
(* ------ signal semaphores (note funny registers)----------------------*)
LIBCALL (base : ExecBasePtr) InitSemaphore*
( VAR sigSem [8] : SignalSemaphore );
- 558;
LIBCALL (base : ExecBasePtr) ObtainSemaphore*
( VAR sigSem [8] : SignalSemaphore );
- 564;
LIBCALL (base : ExecBasePtr) ReleaseSemaphore*
( VAR sigSem [8] : SignalSemaphore );
- 570;
LIBCALL (base : ExecBasePtr) AttemptSemaphore*
( VAR sigSem [8] : SignalSemaphore )
: BOOLEAN;
- 576;
LIBCALL (base : ExecBasePtr) ObtainSemaphoreList*
( VAR sigSem [8] : List );
- 582;
LIBCALL (base : ExecBasePtr) ReleaseSemaphoreList*
( VAR sigSem [8] : List );
- 588;
LIBCALL (base : ExecBasePtr) FindSemaphore*
( sigSem [9] : ARRAY OF CHAR )
: SignalSemaphorePtr;
- 594;
LIBCALL (base : ExecBasePtr) AddSemaphore*
( VAR sigSem [9] : SignalSemaphore );
- 600;
LIBCALL (base : ExecBasePtr) RemSemaphore*
( VAR sigSem [9] : SignalSemaphore );
- 606;
(* ------ kickmem support ----------------------------------------------*)
LIBCALL (base : ExecBasePtr) SumKickData* ()
: ULONG;
- 612;
(* ------ more memory support ------------------------------------------*)
LIBCALL (base : ExecBasePtr) AddMemList*
( size [0] : ULONG;
attributes [1] : SET;
pri [2] : LONGINT;
memBase [8] : APTR;
name [9] : ARRAY OF CHAR );
- 618;
LIBCALL (base : ExecBasePtr) CopyMem*
( source [8] : ARRAY OF SYS.BYTE;
dest [9] : ARRAY OF SYS.BYTE;
size [0] : ULONG );
- 624;
LIBCALL (base : ExecBasePtr) CopyMemAPTR*
( source [8] : APTR;
dest [9] : APTR;
size [0] : ULONG );
- 624;
LIBCALL (base : ExecBasePtr) CopyMemQuick*
( source [8] : ARRAY OF SYS.BYTE;
dest [9] : ARRAY OF SYS.BYTE;
size [0] : ULONG );
- 630;
LIBCALL (base : ExecBasePtr) CopyMemQuickAPTR*
( source [8] : APTR;
dest [9] : APTR;
size [0] : ULONG );
- 630;
(* ------ cache --------------------------------------------------------*)
(* --- functions in V36 or higher (distributed as Release 2.0) ---*)
LIBCALL (base : ExecBasePtr) CacheClearU* ();
- 636;
LIBCALL (base : ExecBasePtr) CacheClearE*
( address [8] : APTR;
length [0] : ULONG;
caches [1] : SET );
- 642;
LIBCALL (base : ExecBasePtr) CacheControl*
( cacheBits [0] : SET;
cacheMask [1] : SET )
: SET;
- 648;
(* ------ misc ---------------------------------------------------------*)
LIBCALL (base : ExecBasePtr) CreateIORequest*
( port [8] : MsgPortPtr;
size [0] : ULONG )
: MessagePtr;
- 654;
LIBCALL (base : ExecBasePtr) DeleteIORequest*
( iorequest [8] : MessagePtr );
- 660;
LIBCALL (base : ExecBasePtr) CreateMsgPort* ()
: MsgPortPtr;
- 666;
LIBCALL (base : ExecBasePtr) DeleteMsgPort*
( port [8] : MsgPortPtr );
- 672;
LIBCALL (base : ExecBasePtr) ObtainSemaphoreShared*
( VAR sigSem [8] : SignalSemaphore );
- 678;
(* ------ even more memory support -------------------------------------*)
LIBCALL (base : ExecBasePtr) AllocVec*
( byteSize [0] : ULONG;
requirements [1] : SET )
: APTR;
- 684;
LIBCALL (base : ExecBasePtr) FreeVec*
( memoryBlock [9] : APTR );
- 690;
LIBCALL (base : ExecBasePtr) CreatePrivatePool*
( requirements [0] : SET;
puddleSize [1] : ULONG;
puddleThresh [2] : ULONG )
: APTR;
- 696;
LIBCALL (base : ExecBasePtr) DeletePrivatePool*
( poolHeader [8] : APTR );
- 702;
LIBCALL (base : ExecBasePtr) AllocPooled*
( poolHeader [8] : APTR;
memSize [0] : ULONG )
: APTR;
- 708;
LIBCALL (base : ExecBasePtr) FreePooled*
( poolHeader [8] : APTR;
memory [9] : APTR );
- 714;
(* ------ misc ---------------------------------------------------------*)
LIBCALL (base : ExecBasePtr) AttemptSemaphoreShared*
( VAR sigSem [8] : SignalSemaphore )
: ULONG;
- 720;
LIBCALL (base : ExecBasePtr) ColdReboot* ();
- 726;
LIBCALL (base : ExecBasePtr) StackSwap*
( VAR newStack [8] : StackSwapStruct );
- 732;
(* ------ task trees ---------------------------------------------------*)
LIBCALL (base : ExecBasePtr) ChildFree*
( tid [0] : APTR );
- 738;
LIBCALL (base : ExecBasePtr) ChildOrphan*
( tid [0] : APTR );
- 744;
LIBCALL (base : ExecBasePtr) ChildStatus*
( tid [0] : APTR );
- 750;
LIBCALL (base : ExecBasePtr) ChildWait*
( tid [0] : APTR );
- 756;
(* ------ future expansion ---------------------------------------------*)
LIBCALL (base : ExecBasePtr) CachePreDMA*
( address [8] : APTR;
VAR length [9] : ULONG;
flags [0] : ULONG )
: APTR;
- 762;
LIBCALL (base : ExecBasePtr) CachePostDMA*
( address [8] : APTR;
VAR length [9] : ULONG;
flags [0] : ULONG );
- 768;
(*------ New, for V39*)
(*--- functions in V39 or higher (Release 3) ---*)
(*------ Low memory handler functions*)
LIBCALL (base : ExecBasePtr) AddMemHandler *
( memhand [9] : InterruptPtr );
-774;
LIBCALL (base : ExecBasePtr) RemMemHandler *
( memhand [9] : InterruptPtr );
-780;
(*------ Function to attempt to obtain a Quick Interrupt Vector...*)
LIBCALL (base : ExecBasePtr) ObtainQuickVector *
( interruptCode [8] : PROC )
: ULONG;
-786;
(**-- C Macros defined as procedures -----------------------------------*)
(** $L+ Absolute long addressing for globals *)
(*
* Check for the presence of any nodes on the given list. These
* macros are even safe to use on lists that are modified by other
* tasks. However; if something is simultaneously changing the
* list, the result of the test is unpredictable.
*
* Unless you first arbitrated for ownership of the list, you can't
* depend on the contents of the list. Nodes might have been added
* or removed during or after the macro executes.
*
* if( IsListEmpty(list) ) printf("List is empty\n");
*)
(**-----------------------------------*)
PROCEDURE IsListEmpty* (VAR x : MinList) : BOOLEAN;
BEGIN (* IsListEmpty *)
RETURN (x.head.succ = NIL)
END IsListEmpty;
(**-----------------------------------*)
PROCEDURE IsMsgPortEmpty* (x : MsgPortPtr) : BOOLEAN;
BEGIN (* IsMsgPortEmpty *)
RETURN (x.msgList.head.succ = NIL)
END IsMsgPortEmpty;
(**----- Module initialisation ----------------------------------------*)
(** $L- address globals through A4 *)
BEGIN
SYS.GET (absExecBase, base); SysBase := base
END Exec.